package link.cocoon.common.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
 * @author xce
 * @date 2020/3/19  17:51
 */
public class ResponseUtil {


  public static void write(HttpServletResponse response, Object object) throws IOException {
    response.setContentType("application/json;charset=UTF-8");
    response.getWriter().write(new ObjectMapper().writeValueAsString(object));
  }

}
